﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SGP.Interface
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void btnEntrar_Click(object sender, EventArgs e)
        {
            if (Security.Login.GetPermissions(
                txtUsuario.Text, txtSenha.Text))
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {

                MessageBox.Show("Usuário ou senha incorretos.\nTente novamente.",
                           "Erro ao autenticar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
